/*
 * bin_search_tree.c
 *
 *  Created on: 2020��1��8��
 *      Author: Administrator
 */
#include "binary_tree.h"

#ifndef BIN_SEARCH_TREE_C_
#define BIN_SEARCH_TREE_C_

typedef struct BTNode BSTree;

BSTree* create_bst(int array[], int length);

bool is_bst_empty(BSTree* root);

int get_bst_nodes(BSTree* root);

BTNode* insert_btnode(BSTree* root, int value);

void preorder_bst(BSTree* root);

void inorder_bst(BSTree* root);
/**
 * 搜索二叉排序树（递归）
 */
BTNode* search_bst(BSTree* root, ElemType key);
/**
 * 搜索二叉排序树（非递归）
 */
BTNode* unr_search_bst(BSTree* root, ElemType key);

void delete_bst(BSTree* root, ElemType key);
#endif /* BIN_SEARCH_TREE_C_ */
